// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.characters;

import fmod.fmod.FMOD_STUDIO_PARAMETER_DESCRIPTION;
import java.util.HashMap;
import zombie.core.Rand;
import zombie.iso.IsoObject;
import zombie.network.GameClient;

public final class DummyCharacterSoundEmitter extends BaseCharacterSoundEmitter {
    public float x;
    public float y;
    public float z;
    private final HashMap<Long, String> sounds = new HashMap();

    public DummyCharacterSoundEmitter(IsoGameCharacter chr) {
        super(chr);
    }

    @Override
    public void register() {
    }

    @Override
    public void unregister() {
    }

    @Override
    public long playVocals(String file) {
        return 0L;
    }

    @Override
    public void playFootsteps(String file, float volume) {
    }

    @Override
    public long playSound(String file) {
        long _long = (long)Rand.Next(Integer.MAX_VALUE);
        this.sounds.put(_long, file);
        if (GameClient.bClient) {
            GameClient.instance.PlaySound(file, false, this.character);
        }

        return _long;
    }

    @Override
    public long playSound(String file, IsoObject proxy) {
        return this.playSound(file);
    }

    @Override
    public long playSoundImpl(String file, IsoObject proxy) {
        long _long = Rand.Next(Long.MAX_VALUE);
        this.sounds.put(_long, file);
        return _long;
    }

    @Override
    public void tick() {
    }

    @Override
    public void set(float _x, float _y, float _z) {
        this.x = _x;
        this.y = _y;
        this.z = _z;
    }

    @Override
    public boolean isClear() {
        return this.sounds.isEmpty();
    }

    @Override
    public void setPitch(long handle, float pitch) {
    }

    @Override
    public void setVolume(long handle, float volume) {
    }

    @Override
    public int stopSound(long channel) {
        if (GameClient.bClient) {
            GameClient.instance.StopSound(this.character, (String)this.sounds.get(channel), false);
        }

        this.sounds.remove(channel);
        return 0;
    }

    @Override
    public void stopSoundLocal(long handle) {
        this.sounds.remove(handle);
    }

    @Override
    public void stopOrTriggerSound(long handle) {
        if (GameClient.bClient) {
            GameClient.instance.StopSound(this.character, (String)this.sounds.get(handle), true);
        }

        this.sounds.remove(handle);
    }

    @Override
    public void stopOrTriggerSoundByName(String name) {
        this.sounds.values().remove(name);
    }

    @Override
    public void stopAll() {
        if (GameClient.bClient) {
            for (String string : this.sounds.values()) {
                GameClient.instance.StopSound(this.character, string, false);
            }
        }

        this.sounds.clear();
    }

    @Override
    public int stopSoundByName(String soundName) {
        this.sounds.values().remove(soundName);
        return 0;
    }

    @Override
    public boolean hasSoundsToStart() {
        return false;
    }

    @Override
    public boolean isPlaying(long channel) {
        return this.sounds.containsKey(channel);
    }

    @Override
    public boolean isPlaying(String alias) {
        return this.sounds.containsValue(alias);
    }

    @Override
    public void setParameterValue(long var1, FMOD_STUDIO_PARAMETER_DESCRIPTION var3, float var4) {
    }

    public boolean hasSustainPoints(long handle) {
        return false;
    }
}
